<template>
  <div>
    <h1>{{p}}</h1>
    <a-button type="button" v-on:click="start" :disabled="disabled">开始</a-button>
    <a-button type="button" @click="stop" :disabled="!disabled">结束</a-button>
  </div>
</template>

<script>
export default {
  name: "Video",
  data(){
   return {
     p:"正在加载，请稍等。。。。。。",
     disabled:false
   }
  },
  methods:{
    start() {
      this.disabled = !this.disabled
      this.time = setInterval(() => {
        let first = this.p.substring(0, 1);
        let end = this.p.substring(1);
        this.p = end + first
      }, 200)
    },
    stop() {
      this.disabled = !this.disabled
      clearInterval(this.time)
    },
  }
}
</script>

<style scoped>

</style>